class LoginController < ApplicationController

  skip_before_filter :check_auth

  def login
    if params[:username] == 'guoyou' && params[:password] == '111111'
      session[:user_id] = 'guoyou'
      flash[:notice] = 'login successful!'
      redirect_to welcome_path
    else
      flash[:notice] = 'username or password incorrect!'
      redirect_to login_path
    end

  end

  def logout
    session[:user_id] = nil
    flash[:notic] = "logout successful"
    redirect_to products_path
  end
end
